import Vue from 'vue'
import Vuex from 'vuex'
import permission from "../router/permission";
Vue.use(Vuex)

const user={
  state: {
    user: {
      username: window.localStorage.getItem('user') == null ? '' : JSON.parse(window.localStorage.getItem('user')).studentnumber,
    }
  },
  getters: {
    getA(state) {
      return state.user.studentnumber
    }
  },
  mutations: {
    login (state, user) {
      // state.user = user
      window.localStorage.setItem('user', JSON.stringify(user))
    }
  },
  // modules:{
  //   permission
  // }
}

const store=new Vuex.Store({
  modules:{
    user,
    permission
  }
})

export default store;
